﻿@using Qcy.Jshj.Web.Helpers;
@model Qcy.Jshj.Web.Models.Order
@{
    ViewBag.Title = "在线订单";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="news_banner">
    <img src="/Content/images/link_banner.jpg" width="990" height="268" alt="" />
</div>
<div class="news_left">
    <div class="news_left_title">
        <span class="en">ORDER</span>
        <span class="cn">联系订购</span>
    </div>
    <ul class="news_left_nav">
        @foreach (var item in DataHelper.GetCompanyInfos(Qcy.Jshj.Web.Models.CompanyInfoType.Order))
        {
            <text>
            <li><a href="/Home/Order/@item.Id">@item.Title</a></li>
            </text>
        }
        <li class="select"><a href="/Home/OnLineOrder">@ApplicationTag.GetTag("Inquiry")</a></li>
    </ul>
    <img class="b_logo" src="~/Content/images/b_logo.gif" alt="@ApplicationTag.GetTag("jiashijia")" />
</div>
<div class="news_right">
    <div class="news_right_nav">
        <a>@ApplicationTag.GetTag("Location")</a> > <span>@ApplicationTag.GetTag("Inquiry")</span>
    </div>
    <div class="right_c">
        <form id="orderForm" action="/Home/OnlineOrder" method="post">
            <table class="order_table">
                <tr>
                    <th>@ApplicationTag.GetTag("Your Name")</th>
                    <td>
                        @Html.TextBoxFor(model => model.LinkMan, new { @class = "order_text" })
                        <span class="red">*</span>
                    </td>
                </tr>
                <tr>
                    <th>@ApplicationTag.GetTag("Company")</th>
                    <td>
                        @Html.TextBoxFor(model => model.CompanyName, new { @class = "order_text" })
                    </td>
                </tr>
                <tr>
                    <th>@ApplicationTag.GetTag("E-mail")</th>
                    <td>
                        @Html.TextBoxFor(model => model.Email, new { @class = "order_text" })
                    </td>
                </tr>
                <tr>
                    <th>@ApplicationTag.GetTag("Telehone")</th>
                    <td>
                        @Html.TextBoxFor(model => model.Phone, new { @class = "order_text" })
                    </td>
                </tr>
                <tr>
                    <th style="vertical-align: top;">@ApplicationTag.GetTag("Message")</th>
                    <td>
                        @Html.TextAreaFor(model => model.Contents, new { @class = "order_txtarea" })
                        <span class="red">*</span>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input id="submit" type="button" class="order_submit_btn" value="@ApplicationTag.GetTag("Submit")" />
                        <input id="reset" type="reset" class="order_reset_btn" value="@ApplicationTag.GetTag("Reset")" />
                    </td>

                </tr>
            </table>
            <script>
                $(function () {
                    $("#submit").click(function () {
                        var msg = "";
                        if ($("#LinkMan").val().length <= 0)
                            msg += "@ApplicationTag.GetTag("Please Input Your Name")\n";
                        if ($("#Contents").val().length <= 0)
                            msg += "@ApplicationTag.GetTag("Please Input Message")\n";
                        if (msg.length > 0) {
                            alert(msg);
                        }
                        else {
                            $.post("/Home/OnLineOrder", $("#orderForm").serialize(), function (data) {
                                if (data.result) {
                                    alert("提交成功,请等待工作人员联系您！");
                                    $("#reset").click();
                                }
                                return false;
                            }, "Json");
                        }
                        return false;
                    });
                });
            </script>
        </form>
    </div>
</div>
